{layout name="common/base" }
<div class="layui-form layuimini-form">
    <div class="layui-form-item">
        <label class="layui-form-label required">类别名称</label>
        <div class="layui-input-block">
            <input type="text" name="name" lay-verify="required" lay-reqtext="类别名称不能为空" placeholder="请输入类别名称" value="" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">封面图</label>
        <div class="layui-input-block">
            <button type="button" class="layui-btn" id="upload_btn">
                <i class="layui-icon">&#xe67c;</i>上传图片
            </button>
            <div><tip>上传图片正方形</tip></div>
            <img id="previewImg" width="60px" height="60px">
            <input id="upload_image" name="thumb" type="hidden" multiple="true" value="">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">状态</label>
        <div class="layui-input-block">
            <input type="radio" name="status" value="0" title="禁用" checked="">
            <input type="radio" name="status" value="1" title="开启">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">排序</label>
        <div class="layui-input-block">
            <input type="number" name="sort" placeholder="请输入排序" value="" class="layui-input">
            <tip>只能输入数字!</tip>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit lay-filter="saveBtn">确认保存</button>
        </div>
    </div>
</div>
<script src="__PUBLIC__/lib/jquery-3.4.1/jquery-3.4.1.min.js" charset="utf-8"></script>
<script src="__PUBLIC__/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script src="__PUBLIC__/js/commons.js" charset="utf-8"></script>
<script src="__PUBLIC__/js/image.js" charset="utf-8"></script>
<script type="text/javascript">
    var url = '/admin/Category/add';
    add_edit(url);
    image_upload();
</script>
